#ifndef __ALSA_PLAYER_H
#define __ALSA_PLAYER_H

#pragma once

#include "AlsaCore.h"

/**
 * Class Inheritance Chart
 *
 *                   AlsaCore
 *                      |
 *                      |-------------------------------|
 *                      |                               |
 *              AlsaPcmBufferPlayer             AlsaAudioFilePlayer
 *                      |
 *               AlsaPcmFilePlayer
 *                      |
 *              AlsaWaveFilePlayer
 *
 */

class AlsaPcmBufferPlayer : public AlsaCore
{
public:
	AlsaPcmBufferPlayer();
	virtual ~AlsaPcmBufferPlayer();

	// old: int playrawbuffer(unsigned char * buffer, int size);
	int PlayPcmBuffer(unsigned char * buffer, int size);
};

class AlsaPcmFilePlayer : public AlsaPcmBufferPlayer
{
public:
	AlsaPcmFilePlayer();
	virtual ~AlsaPcmFilePlayer();

	// old: int playraw(char *filename);		// Play raw PCM file
	int Play(char *filename);		            // Play raw PCM file

protected:
    // old: void playbackraw(char *name);		// Control raw PCM file play
    void PlayPcmFile(char *filename);		// Control raw PCM file play
};

class AlsaWaveFilePlayer : public AlsaPcmFilePlayer
{
public:
	AlsaWaveFilePlayer();
	virtual ~AlsaWaveFilePlayer();

	int Play(char *filename);		            // Play wav PCM file
};

/**
 * Player for audio file. Supports: wav, au, voc
 * The player will open the audio file and check for the audio file header to
 * determine the audio type
 */
class AlsaAudioFilePlayer : public AlsaCore
{
public:
	AlsaAudioFilePlayer();
	virtual ~AlsaAudioFilePlayer();

    int Play(char *filename);       // Control raw PCM file play
};


#endif
